#include <boost/json/error.hpp>
#include <boost/json/parse_options.hpp>
#include <cstddef>
#include <iostream>
#include <fstream>
#include <boost/json.hpp>
#include <iterator>
#include <memory>
#include <ostream>
#include <vector>
int main()
{
    std::fstream fs;
    fs.open("test.json");
    if(!fs.is_open()){
        std::cerr<<"File Error"<<std::endl;
        return  1;
    }
    std::unique_ptr<char[]> pdata(new char [1024]);
    fs.read(pdata.get(),1024);
    boost::json::parse_options ps;
    ps.allow_comments = true;
    ps.allow_invalid_utf8 = true;
    boost::json::error_code er;
    auto val = boost::json::parse(pdata.get(),er,{},ps);
    if(er.failed()){
        std::cerr<<"Parse"<<std::endl;
    }
    if(val.is_object()){
        std::cout<<"Is a Obj"<<std::endl;
    }
    auto q = val.as_object().find("a");
    std::cout<<q->value().as_string().c_str()<<std::endl;
}
